#include<bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f
#define cmin(a,b) a=min(a,b)
#define cmax(a,b) b=max(a,b)
#define rst(a,b) memset(a,b,sizeof(a))
#define ls p<<1
#define rs p<<1|1
#define lowbit(x) ((x)&-(x))

using namespace std;

const int N(1e5+5);
int n,a[N],b[N],ans;

int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        b[a[i]]++;
    }
    for(int i=1,j=0;i<=100000;i++){
        if(!b[i]) continue;
        for(int k=1;k<=b[i];k++){
            while(j<i&&!b[j]) j++;
            if(j!=i) ans++,b[j]--;
        }
    }
    cout<<n-ans;
    return 0;
}